<template>
		<uni-card :title="club.name" :sub-title="club.leaderName" :extra="clubStatus" :thumbnail="club.club_avatar" @click="onClick">
			<text class="uni-body">{{ club.description }}</text>
		</uni-card>
</template>
 
<script setup>
import { storeToRefs } from 'pinia'	
import { computed, ref, onMounted } from 'vue'
	
import useLoginStore from '@/store/login.js'	
import useClubStore from '@/store/club.js'

const loginStore = useLoginStore()
const clubStore = useClubStore()

const { userInfo } = storeToRefs(loginStore)
const { clubMemberInfo } = storeToRefs(clubStore)
const { club } = defineProps({
	club:{
		type: Object
	}
})

onMounted(() => {
	clubStore.getClubMemberStatusAction(club.id)
})

const clubStatus = computed(() => {
	switch(club.status) {
		case 'pending': 
			return '管理员审核中'
		case 'approved':
			return '已加入'
		case 'rejected':
			return '管理员已拒绝'
	}
})



</script>

<style lang="less">

</style>